//
//  SjVc.swift
//  GjCup
//
//  Created by abc on 2024/4/8.
//

import UIKit

class SjVc: UIViewController {
    
    
    @IBOutlet weak var sTf: UITextField!
    @IBOutlet weak var eTf: UITextField!
    
    @IBOutlet weak var rBtn: UIButton!{
        didSet{
            rBtn.layer.cornerRadius = 6
        }
    }
    @IBOutlet weak var sLa: UILabel!
    
    override func viewDidLoad() {
        super.viewDidLoad()

        // Do any additional setup after loading the view.
    }
    
    @IBAction func rAc(_ sender: UIButton) {
        let s = Int(sTf.text ?? "") ?? 0
        let e = Int(eTf.text ?? "") ?? 0
        if s == 0 || e == 0 {
            
            UIAlertController.ok_alert("请输入起始值/结束值", self)
            return
        }
        let num = Int(arc4random()) % (e - s) + s
        sLa.text = "\(num)"

        
    }
    
    /*
    // MARK: - Navigation

    // In a storyboard-based application, you will often want to do a little preparation before navigation
    override func prepare(for segue: UIStoryboardSegue, sender: Any?) {
        // Get the new view controller using segue.destination.
        // Pass the selected object to the new view controller.
    }
    */

}
